<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
    <script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
</head>
<body>
    <span class="layui-breadcrumb" >
        <a ><cite><i class="fa fa-map-marker"></i>位置</cite></a>
        <a href="<?=site_url('vod/admin/vod')?>">音乐</a>
        <a href="<?=site_url('vod/admin/lists')?>">视频分类</a>
    </span>
    <form class="layui-form" action="<?=site_url('vod/admin/lists/plsave')?>" method="post">
    <table class="layui-table">
        <thead>
        <tr>
            <th>编号/名称</th>
            <th class="phide">排序</th>
            <th>中文名</th>
            <th class="phide">英文名</th>
            <th class="phide">分类模板</th>
            <th class="phide">内容模板</th>
            <th class="phide">播放模板</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
    <?php
        foreach ($vod_list as $row) {
        //数量
            $nums=$this->Csdb->get_allnums("SELECT id FROM ".CS_SqlPrefix."vod where cid=".$row->id."");
            //状态
            $zt=($row->yid==0)?'<a title="点击隐藏" href="javascript:cscms.ok_no(\''.site_url('vod/admin/lists/init').'\','.$row->id.',0,\'zt_\');"><i class="fa fa-check colorl"></i></a>':'<a title="点击显示" href="javascript:cscms.ok_no(\''.site_url('vod/admin/lists/init').'\','.$row->id.',1,\'zt_\');"><i class="fa fa-close colorr"></i></a>';
            echo '<tr id="row_'.$row->id.'">
            <td><input style="display: inline-block;" name="id['.$row->id.']" class="xuan" type="checkbox" value="'.$row->id.'">'.$row->id.'、'.$row->name.'(<font color="red">'.$nums.'</font>)</td>
            <td class="phide"><input class="td-input1" name="xid_'.$row->id.'" value="'.$row->xid.'"></td>
            <td><input class="td-input2" name="name_'.$row->id.'" value="'.$row->name.'"></td>
            <td class="phide"><input class="td-input2" name="bname_'.$row->id.'" value="'.$row->bname.'"></td>
            <td class="phide"><input class="td-input2" name="skins_'.$row->id.'" value="'.$row->skins.'"></td>
            <td class="phide"><input class="td-input2" name="skins2_'.$row->id.'" value="'.$row->skins2.'"></td>
            <td class="phide"><input class="td-input2" name="skins3_'.$row->id.'" value="'.$row->skins3.'"></td>
            <td id="zt_'.$row->id.'" style="max-width: 60px;text-align: center;">'.$zt.'</td>
            <td class="basedb-more">
            <a class="layui-btn layui-btn-mini" href="javascript:cscms.get_open(\''.site_url('vod/admin/lists/edit').'?id='.$row->id.'\',\'修改分类\',\'500px\',\'400px\');">修改</a>
            <a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:cscms.del_one(\''.site_url('vod/admin/lists/del').'\','.$row->id.');">删除</a>
            <a class="layui-btn layui-btn-mini layui-btn-normal" href="javascript:cscms.get_open(\''.site_url('vod/admin/lists/edit').'?fid='.$row->id.'\',\'新增分类\',\'500px\',\'400px\');" >新增</a>
            </td>
            </tr>';


            $sql_string = "SELECT * FROM ".CS_SqlPrefix."vod_list where fid=".$row->id." order by xid asc";
            $query = $this->db->query($sql_string); 
            foreach ($query->result() as $rows) {
                    //数量
                    $nums=$this->Csdb->get_allnums("SELECT id FROM ".CS_SqlPrefix."vod where cid=".$rows->id."");
                    //状态
                    $zt=($rows->yid==0)?'<a title="点击隐藏" href="javascript:cscms.ok_no(\''.site_url('vod/admin/lists/init').'\','.$rows->id.',0,\'zt_\');"><i class="fa fa-check colorl"></i></a>':'<a title="点击显示" href="javascript:cscms.ok_no(\''.site_url('vod/admin/lists/init').'\','.$rows->id.',1,\'zt_\');"><i class="fa fa-close colorr"></i></a>';
                    echo '<tr id="row_'.$rows->id.'">
                    <td><input style="display: inline-block;" class="xuan" name="id['.$rows->id.']" type="checkbox" value="'.$rows->id.'">&nbsp;&nbsp;├&nbsp;'.$rows->id.'、'.$rows->name.'(<font color="red">'.$nums.'</font>)</td>
                    <td class="phide"><input class="td-input1" name="xid_'.$rows->id.'" value="'.$rows->xid.'"></td>
                    <td><input class="td-input2" name="name_'.$rows->id.'" value="'.$rows->name.'"></td>
                    <td class="phide"><input class="td-input2" name="bname_'.$rows->id.'" value="'.$rows->bname.'"></td>
                    <td class="phide"><input class="td-input2" name="skins_'.$rows->id.'" value="'.$rows->skins.'"></td>
                    <td class="phide"><input class="td-input2" name="skins2_'.$rows->id.'" value="'.$rows->skins2.'"></td>
                    <td class="phide"><input class="td-input2" name="skins3_'.$rows->id.'" value="'.$rows->skins3.'"></td>
                    <td id="zt_'.$rows->id.'" style="max-width: 60px;text-align: center;">'.$zt.'</td>
                    <td class="basedb-more">
                    <a class="layui-btn layui-btn-mini" href="javascript:cscms.get_open(\''.site_url('vod/admin/lists/edit').'?id='.$rows->id.'\',\'修改分类\',\'500px\',\'400px\');">修改</a>
                    <a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:cscms.del_one(\''.site_url('vod/admin/lists/del').'\','.$rows->id.');">删除</a>
                    </td>
                    </tr>';
                }
            }
            ?>
        </tbody>
    </table>
    <div class="more_func">
        <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.select_all();"><i class="fa fa-check colorl" ></i>全选/反选</a>
        <a class="layui-btn layui-btn-primary layui-btn-small" lay-submit lay-filter="setting"><i class="fa fa-pencil colorb"></i>修改选中</a>
        <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.get_open('<?=site_url('vod/admin/lists/edit')?>','新增分类','500px','400px');"><i class="fa fa-plus colorn"></i>&nbsp;新增大类</a>
        <div class="next-line" style="margin-bottom: 10px;">转移到
            <div class="layui-input-inline" style="width: 120px;" >
                <select name="cid" id="zhuan">
                    <option value="0">请选择类别</option>
                    <?php
                    $query = $this->db->query("SELECT id,name FROM ".CS_SqlPrefix."vod_list where fid=0 order by xid asc"); 
                    foreach ($query->result() as $row) {
                        echo '<option value="'.$row->id.'">'.$row->name.'</option>';
                        $sql_string = "SELECT id,name FROM ".CS_SqlPrefix."vod_list where fid=".$row->id." order by xid asc";
                        $query = $this->db->query($sql_string); 
                        foreach ($query->result() as $row2) {
                             echo '<option value="'.$row2->id.'">'.$row2->name.'</option>';
                        }
                    }
                    ?>
                </select>
            </div>
            <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.go_confirm('<?=site_url('vod/admin/lists/zhuan')?>','确定转移该分类下面的所有视频吗？',2);"><i class="fa fa-hand-o-right colord"></i>确定转移</a>
        </div>
    </div>
    </form>
    <script type="text/javascript">
        cscms.init();
    </script>
</body>
</html>